package dao.jpa;

import java.util.List;

import vo.Element;
import dao.ElementDAO;

public class ElementDAOJpaImpl extends GenericDaoJpaImpl<Element, Long> implements ElementDAO {

	public ElementDAOJpaImpl() {
		super(Element.class);
	}

	public List<Element> findAll() {
		return super.executeFinder("Element.findAll");       
	}

	public List<Element> findByTemplateId(long templateId) {
		return super.executeFinder("Element.findByTemplateId",templateId);       
	}

	public Element findByTemplateIdName(long tId,String name) {
		return super.executeSingleFinder("Element.findByTemplateIdName",tId,name);       
	}
	public Element getById(long id) {
		return super.read(id);
	}

	public void update(long id) {
		Element e= super.read(id);
		super.update(e);
	}

	public void delete(long id)// 真正删除 
	{
		Element e = super.read(id);
		super.delete(e);
	}


}
